home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / RCS / Fs_WriteBack.c,v < prev    next >
Encoding:
Text File  |  1991-12-09  |  2.2 KB  |  103 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.1.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     88.06.19.14.29.15;  author ouster;  state Exp;
  11. branches 1.1.1.1;
  12. next     ;
  13.  
  14. 1.1.1.1
  15. date     91.12.08.17.06.27;  author kupfer;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24.  
  25. 1.1
  26. log
  27. @Initial revision
  28. @
  29. text
  30. @/* 
  31.  * Fs_WriteBack.c --
  32.  *
  33.  *    Source code for the Fs_WriteBack library procedure.
  34.  *
  35.  * Copyright 1988 Regents of the University of California
  36.  * Permission to use, copy, modify, and distribute this
  37.  * software and its documentation for any purpose and without
  38.  * fee is hereby granted, provided that the above copyright
  39.  * notice appear in all copies.  The University of California
  40.  * makes no representations about the suitability of this
  41.  * software for any purpose.  It is provided "as is" without
  42.  * express or implied warranty.
  43.  */
  44.  
  45. #ifndef lint
  46. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  47. #endif not lint
  48.  
  49. #include <sprite.h>
  50. #include <fs.h>
  51.  
  52.  
  53. /*
  54.  *----------------------------------------------------------------------
  55.  *
  56.  * Fs_WriteBack --
  57.  *
  58.  *    Force the given file to disk.
  59.  *
  60.  * Results:
  61.  *    SUCCESS if could open and force to disk, an error otherwise.
  62.  *
  63.  * Side effects:
  64.  *    File forced to disk.
  65.  *
  66.  *----------------------------------------------------------------------
  67.  */
  68. ReturnStatus
  69. Fs_WriteBack(fileName, firstByte, lastByte, shouldBlock)
  70.     char    *fileName;        /* Name of file to write back. */
  71.     int        firstByte;        /* First byte to write back, -1 if 
  72.                      * should write-back the lowest first
  73.                      * byte */
  74.     int        lastByte;        /* Last byte to write back, -1 if 
  75.                      * should write-back the highest last
  76.                      * byte */
  77.     Boolean    shouldBlock;        /* TRUE => should wait for the file
  78.                      * to be put on disk. */
  79. {
  80.     int            fd;
  81.     ReturnStatus    status;
  82.  
  83.     status = Fs_Open(fileName, FS_READ, 0, &fd);
  84.     if (status != SUCCESS) {
  85.     return(status);
  86.     }
  87.     status = Fs_WriteBackID(fd, firstByte, lastByte, shouldBlock);
  88.     Fs_Close(fd);
  89.     return(status);
  90. }
  91. @
  92.  
  93.  
  94. 1.1.1.1
  95. log
  96. @Initial branch for Sprite server.
  97. @
  98. text
  99. @d17 1
  100. a17 1
  101. static char rcsid[] = "$Header: /sprite/src/lib/c/syscall/RCS/Fs_WriteBack.c,v 1.1 88/06/19 14:29:15 ouster Exp $ SPRITE (Berkeley)";
  102. @
  103.